﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public partial class tag
    {
        public static CommonClasses.TagsResponse PesquisaTags(string Query)
        {
            try
            {
                using (DBEntity entidade = new DBEntity())
                {
                    CommonClasses.TagsResponse response = new CommonClasses.TagsResponse();
                    response.options = (from ent in entidade.tag
                           where ent.name.StartsWith(Query)
                           select ent.name).ToArray();
                    return response;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
    }
}
